import React, { useEffect, useState } from 'react';
import './index.less';

const Main = () => {
  const [count, setCount] = useState(0);

  useEffect(() => {
    // 此处可以添加页面初始化时的逻辑
  }, []);

  return (
    <div className="home" id="home">
      <div className="welcome-section">
        <h1>欢迎来到携程前端训练营第六课之React+Webpack+TS+Less系统</h1>
        <p>这是一个用于演示的主页面。</p>
      </div>
      <div className="counter-section">
        <p>页面计数器: {count}</p>
        <button onClick={() => setCount(count + 1)}>增加计数</button>
        <button onClick={() => setCount(count - 1)}>减少计数</button>
      </div>
    </div>
  );
};

export default Main;
